cmake_minimum_required(VERSION 3.16)

project(live555)

include_directories(
  ${PROJECT_SOURCE_DIR}/groupsock/include
  ${PROJECT_SOURCE_DIR}/UsageEnvironment/include
  ${PROJECT_SOURCE_DIR}/BasicUsageEnvironment/include
  ${PROJECT_SOURCE_DIR}/liveMedia/include
  ${PROJECT_SOURCE_DIR}/liveMedia
)

add_definitions(-DXLOCALE_NOT_USED=1)
add_definitions(-DSOCKLEN_T=socklen_t)
add_definitions(-DNO_SSTREAM=1)
add_definitions(-D_LARGEFILE_SOURCE=1)
add_definitions(-D_FILE_OFFSET_BITS=64)
add_definitions(-DBSD=1)


file(GLOB_RECURSE groupsock_src 
  ${PROJECT_SOURCE_DIR}/groupsock/*.cpp
  ${PROJECT_SOURCE_DIR}/groupsock/*.c
)
add_library(groupsock STATIC ${groupsock_src})


file(GLOB_RECURSE UsageEnvironment_src 
  ${PROJECT_SOURCE_DIR}/UsageEnvironment/*.cpp
)
add_library(UsageEnvironment STATIC ${UsageEnvironment_src})

file(GLOB_RECURSE BasicUsageEnvironment_src 
  ${PROJECT_SOURCE_DIR}/BasicUsageEnvironment/*.cpp
)
add_library(BasicUsageEnvironment STATIC ${BasicUsageEnvironment_src})


file(GLOB_RECURSE liveMedia_src 
  ${PROJECT_SOURCE_DIR}/liveMedia/*.cpp
  ${PROJECT_SOURCE_DIR}/liveMedia/*.c
)
add_library(liveMedia STATIC ${liveMedia_src})